<!-- 屏蔽雇主 -->
<template>
	<view class="page-shield">
		<view class="list-box">
			<view class="item-box" v-for="(item,index) in joblist" :key="index">
				<view class="name">
					{{item}}
				</view>
				<view class="bnt-box" @click="relieve(index)">
					解除
				</view>
			</view>
		</view>
		<!-- <u-loadmore v-if="newbtmshow >0" :status="status" /> -->
		<!-- <Empty v-if="joblist.length == 0" text='列表为空' /> -->
		<view class="add-box">
			<view class="shield" @click="jumpBnt">
				<text>添加屏蔽的雇主</text>
			</view>
		</view>
	</view>
</template>

<script>
import * as user from '@/api/user.js'
	export default {
		name: 'Browse',
		data(){
			return{
				joblist:[],//需求列表
				tolbs: 0, //分页总数
				listdata: {
				},
			}
		},
		onShow() {
			this.getjob()
		},
		onPullDownRefresh() {
			this.getjob()
			uni.stopPullDownRefresh();
		},
		methods:{
			 getjob() {
				 user.shieldList().then(res => {
					this.joblist = res.data
				})
			},
			jumpBnt() {
				this.$tools.navigate('/pages/user/shield/seek/index')
			},
			// 解除屏蔽
			relieve(e) {
				console.log(e)
					uni.showModal({
					    title: '提示',
					    content: '确定解除该雇主吗?',
					    success:(res)=> {
							if (res.confirm) {
								user.shield({id:e}).then(res=>{
									this.$tools.toast('解除屏蔽雇主成功!');
									setTimeout(res=>{
										this.getjob()
									},500)
								})
							}
					    }
					})
			},
		}
	}
</script>

<style scoped lang="scss">
	.page-shield {
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		.list-box {
			background: #ffffff;
			padding: 0rpx 15rpx 0rpx 15rpx;
			.item-box {
				border-bottom: 2rpx solid #f4f4f4;
				display: flex;
				padding: 30rpx;
				align-items: center;
				.name {
					width: 600rpx;
				}
				.bnt-box {
					width: 100rpx;
					height: 50rpx;
					background: #FF6600;
					margin-left: auto;
					border-radius: 15rpx;
					text-align: center;
					line-height: 50rpx;
					color: #ffffff;
				}
			}
		}
		.add-box {
			position: fixed;
			bottom: 150rpx;
			left: 0;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			.shield {
				padding: 25rpx;
				background: #FF6600;
				border-radius: 4rpx;
				font-size: 36rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				text-align: center;
				border-radius: 15rpx;
			}
		}
	}
</style>
